//
//  ChangeSexViewController.m
//  HDYS
//
//  Created by qianfeng on 15-5-6.
//  Copyright (c) 2015年 kay. All rights reserved.
//

#import "ChangeSexViewController.h"

@interface ChangeSexViewController () <UITableViewDataSource, UITableViewDelegate>
{
    NSArray *_array;
}
@end

@implementation ChangeSexViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _array = @[@"男", @"女"];
    
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _array.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellId = @"cellId";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 60, 18)];
        label.text = _array[indexPath.row];
        label.font = [UIFont systemFontOfSize:12];
        [cell.contentView addSubview:label];
    }
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 28.0f;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
